package leecode

func getIntersectionNodeLCR23(headA, headB *ListNode) *ListNode {
	hashMap := make(map[*ListNode]int) //key为对应的节点 , value为值
	for headA != nil {
		hashMap[headA] = headA.Val
		headA = headA.Next
	}
	for headB != nil {
		if _, ok := hashMap[headB]; ok {
			return headB
		}
		headB = headB.Next
	}
	return nil
}
